package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.param.BaseParam;
import com.cskaoyan.bean.pojo.MarketComment;
import com.cskaoyan.bean.vo.CommentListVO;
import com.cskaoyan.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description 商品评论controller
 * @date        2022.04.07 23:02
 * @package     com.cskaoyan.controller
 * @Classname   GoodsCommentController
 * @author      rebaogu
 */
@RestController
@RequestMapping("admin/comment")
public class GoodsCommentController {

    @Autowired
    CommentService goodsCommentService;


    @RequestMapping("list")
    public BaseRespVo commentList(BaseParam baseParam,Integer userId,Integer valueId ) {
        CommentListVO commentListVO = goodsCommentService.commentList(baseParam, userId, valueId);
        return BaseRespVo.ok(commentListVO);
    }


    @RequestMapping("delete")
    public BaseRespVo commentDelete(@RequestBody MarketComment marketComment) {
        goodsCommentService.commentDelete(marketComment);
        return BaseRespVo.ok("成功");
    }

}
